package com.cq.hd.member.api;

import com.cq.hd.common.pagination.Page;
import com.cq.hd.common.response.Result;
import com.cq.hd.member.api.dto.*;
import com.cq.hd.member.api.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "hd-o2o-member-service", contextId = "business-points-mall-api")
public interface TbBusinessPointsMallApi {

    // 获取积分规则
    @GetMapping("/member/businessPointsMall/getSettings")
    Result<BusinessPointsMallSettingsVo> getSettings(@RequestParam("businessId") Long businessId);

    // 设置积分规则
    @PostMapping("/member/businessPointsMall/save")
    Result<Boolean> saveSettings(@RequestBody BusinessPointsMallSettingsDto businessPointsMallSettingsDto);

    // 获取优惠券、核销商品列表
    @PostMapping("/member/businessPointsMall/getProductList")
    Result<List<BusinessPointsMallProductVo>> getProductList(@RequestBody BusinessPointsMallProductListDto businessPointsMallProductListDto);

    // 添加编辑优惠券
    @PostMapping("/member/businessPointsMall/saveCoupon")
    Result<Boolean> saveCoupon(@RequestBody BusinessPointsMallCouponDto businessPointsMallCouponDto);

    // 添加编辑核销商品
    @PostMapping("/member/businessPointsMall/saveGoods")
    Result<Boolean> saveGoods(@RequestBody BusinessPointsMallGoodsDto businessPointsMallGoodsDto);

    // 删除优惠券、核销商品
    @PostMapping("/member/businessPointsMall/removeProduct")
    Result<Boolean> removeProduct(@RequestParam("id") Long id, @RequestParam("businessId") Long businessId);

    // 开启积分商城
    @PostMapping("/member/businessPointsMall/open")
    Result<Boolean> open(@RequestParam("businessId") Long businessId);

    // 关闭积分商城
    @PostMapping("/member/businessPointsMall/close")
    Result<Boolean> close(@RequestParam("businessId") Long businessId);

    // 策划人手动调整积分
    @PostMapping("/member/businessPointsMall/businessChangePoints")
    Result<Boolean> businessChangePoints(@RequestBody BusinessChangePointsDto businessChangePointsDto);

    // 用户积分列表
    @PostMapping("/member/businessPointsMall/pageUserPointsAccount")
    Result<Page<UserPointsAccountPageVo>> pageUserPointsAccount(@RequestBody UserPointsAccountPageDto userPointsAccountPageDto);

    // 用户积分详情
    @PostMapping("/member/businessPointsMall/userPointsAccount")
    Result<UserPointsAccountPageVo> userPointsAccount(@RequestParam("businessId") Long businessId, @RequestParam("userId") Long userId);

    // 用户积分明细
    @PostMapping("/member/businessPointsMall/pageUserPointsDetail")
    Result<Page<UserPointsDetailPageVo>> pageUserPointsDetail(@RequestBody UserPointsDetailPageDto userPointsDetailPageDto);

    // 商家积分商城主页
    @GetMapping("/member/businessPointsMall/getHomePage")
    Result<BusinessPointsMallHomePageVo> getHomePage(@RequestParam("businessId") Long businessId, @RequestParam("userId") Long userId);

    // 管理后台：积分商家列表
    @PostMapping("/member/businessPointsMall/pageBusiness")
    Result<Page<BusinessPointsMallPageVo>> pageBusiness(@RequestBody BusinessPointsMallPageDto businessPointsMallPageDto);

    // 管理后台：商家积分商品列表
    @PostMapping("/member/businessPointsMall/pageProducts")
    Result<Page<BusinessPointsMallProductPageVo>> pageProducts(@RequestBody BusinessPointsMallProductPageDto businessPointsMallProductPageDto);

    // 管理后台：用户积分明细
    @PostMapping("/member/businessPointsMall/adminPageUserPointsDetail")
    Result<Page<AdminUserPointsDetailPageVo>> adminPageUserPointsDetail(@RequestBody AdminUserPointsDetailPageDto adminUserPointsDetailPageDto);

    // 分享赚积分
    @PostMapping("/member/businessPointsMall/getShareActivePoints")
    Result<Boolean> getShareActivePoints(@RequestBody ShareActivePointsDto shareActivePointsDto);

    // 商品详情
    @PostMapping("/member/businessPointsMall/productDetail")
    Result<BusinessPointsMallProductDetailVo> productDetail(@RequestParam("id") Long id, @RequestParam("userId") Long userId);

    // 积分兑换
    @PostMapping("/member/businessPointsMall/exchange")
    Result<Boolean> exchange(@RequestParam("productId") Long productId, @RequestParam("userId") Long userId);

    // 订单结算，给用户、经纪人发放积分
    @PostMapping("/member/businessPointsMall/subOrderSettlePoints")
    Result<Boolean> subOrderSettlePoints(@RequestBody OrderItemPointsSettleDto orderItemPointsVo);

    // 积分订单取消，退回积分
    @PostMapping("/member/businessPointsMall/cancelOrderSendBackPoints")
    Result<Boolean> cancelOrderSendBackPoints(@RequestParam("orderId") Long orderId);

    // 分享积分商城
    @PostMapping("/member/businessPointsMall/share")
    Result<BusinessPointsMallShareVo> share(@RequestParam("businessId") Long businessId);
}